package ruifight.member.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import ruifight.member.dao.NoticeInfoMapper;
import ruifight.member.model.NoticeInfo;
import ruifight.member.model.NoticeInfoExample;
import ruifight.member.service.NoticeInfoService;
import ruifight.member.service.base.BaseServiceImpl;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class NoticeInfoServiceImpl extends BaseServiceImpl<NoticeInfo, NoticeInfoExample, Long> implements NoticeInfoService {

    @Resource
    private NoticeInfoMapper noticeInfoMapper;

    public PageInfo<Map<String, Object>> getNoticeInfoList(int cur_page, int page_size, Map<String, Object> paramMap){
        PageHelper.startPage(cur_page, page_size);
        List<Map<String, Object>> pageList = noticeInfoMapper.getNoticeInfoList(paramMap);
        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(pageList);
        return pageInfo;
    }

	@Override
	public NoticeInfo getLastNoticeInfo() {
		
		return noticeInfoMapper.getLastNoticeInfo();
	}

}
